<?php
namespace SixShop\News\Service;
// 资讯服务适配器：开发模式用 PHP Service，分发模式用 FFI 适配层
class NewsServiceAdapter
{
    protected $service;
    public function __construct()
    {
        if (class_exists('NewsService', false) || file_exists(__DIR__ . '/NewsService.php')) {
            // 开发模式：用 PHP Service
            require_once __DIR__ . '/NewsService.php';
            $this->service = new NewsService();
        } else {
            // 分发模式：用 FFI 适配层
            require_once __DIR__ . '/NewsServiceFFI.php';
            $this->service = new NewsService();
        }
    }
    public function getList(...$args) { return $this->service->getList(...$args); }
    public function getById(...$args) { return $this->service->getById(...$args); }
    public function create(...$args) { return $this->service->create(...$args); }
    public function update(...$args) { return $this->service->update(...$args); }
    public function delete(...$args) { return $this->service->delete(...$args); }
    public function generateSummary(...$args) { return $this->service->generateSummary(...$args); }
    public function checkContent(...$args) { return $this->service->checkContent(...$args); }
    public function extractKeywords(...$args) { return $this->service->extractKeywords(...$args); }
} 